package com.lantosec.hmrp.modules.category.vo;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import java.io.Serializable;
import com.lantosec.hmrp.modules.category.entity.AssetsCategory;
import com.lantosec.hmrp.core.mvc.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 资产类别表 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-31
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="AssetsCategory对象", description="资产类别表")
public class AssetsCategoryVO extends BaseVO<AssetsCategory> {
    private static final long serialVersionUID = 1L;


    public AssetsCategoryVO(AssetsCategory entity){
        this.categoryId = entity.getCategoryId();
        this.categoryName = entity.getCategoryName();
        this.parentId = entity.getParentId();
        this.leaf = entity.getLeaf();
        this.serviceLife = entity.getServiceLife();
        this.remark = entity.getRemark();
        this.categoryOrder = entity.getCategoryOrder();
    }

    @Override
    public AssetsCategory convertToEntity(){
        return new AssetsCategory(this);
    }


    @ApiModelProperty(value = "分类ID(3+3模式，自动生成)")
    private String categoryId;

    @ApiModelProperty(value = "分类名称")
    private String categoryName;

    @ApiModelProperty(value = "上级分类ID")
    private String parentId;

    @ApiModelProperty(value = "是否末级(0否,1是)")
    private Boolean leaf;

    @ApiModelProperty(value = "折旧年限(月)")
    private Integer serviceLife;

    @ApiModelProperty(value = "说明")
    private String remark;

    @ApiModelProperty(value = "排序")
    private Integer categoryOrder;


}
